﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ChooseRoutine.aspx.cs" Inherits="FatFreeFitness._secured.members.ChooseRoutine" masterpagefile="../../_layout/_master/MemberMaster.master" %>
<asp:Content id="Content1" runat="Server" contentplaceholderid="MemberContent">
    <div>
    
        <asp:HiddenField ID="hidMembershipKey" runat="server" />
    
    </div>
    <asp:FormView ID="FormView1" runat="server" DataKeyNames="ID" 
        DataSourceID="EntityDsMember" DefaultMode="Edit" 
        onitemcommand="FormView1_ItemCommand" onitemupdated="FormView1_ItemUpdated" 
        Width="372px">
        <EditItemTemplate>
            &nbsp;<asp:Label ID="IDLabel1" runat="server" Text='<%# Eval("ID") %>' 
                Visible="False" />
            <asp:EntityDataSource ID="EntityDsTemplateRoutines" runat="server" 
                ConnectionString="name=FatFreeFitnessEntities" 
                DefaultContainerName="FatFreeFitnessEntities" EnableFlattening="False" 
                EntitySetName="TemplateRoutines" 
                Include="TemplateRoutineSteps.TemplateStep">
            </asp:EntityDataSource>
            <asp:EntityDataSource ID="EntityDsTemplateSteps" runat="server" 
                ConnectionString="name=FatFreeFitnessEntities" 
                DefaultContainerName="FatFreeFitnessEntities" EnableFlattening="False" 
                EntitySetName="TemplateSteps" Include="Resource" 
                Where="EXISTS(SELECT VALUE r FROM it.TemplateRoutineSteps AS r WHERE r.RoutineID = @RoutineID)">
                <WhereParameters>
                    <asp:ControlParameter ControlID="DropDownList2" Name="RoutineID" 
                        PropertyName="SelectedValue" Type="Int32" />
                </WhereParameters>
            </asp:EntityDataSource>
            <br />
            Routine:
            <asp:DropDownList ID="DropDownList2" runat="server" 
                DataSourceID="EntityDsTemplateRoutines" DataTextField="Name" 
                DataValueField="ID" SelectedValue='<%# Bind("RoutineID") %>' 
                AutoPostBack="True">
            </asp:DropDownList>
            <br />
            <br />
            <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" 
                CellSpacing="0" DataSourceID="EntityDsTemplateSteps" GridLines="None">
                <MasterTableView DataKeyNames="ID" DataSourceID="EntityDsTemplateSteps">
                    <CommandItemSettings ExportToPdfText="Export to PDF" />
                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" 
                        Visible="True">
                        <HeaderStyle Width="20px" />
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" 
                        Visible="True">
                        <HeaderStyle Width="20px" />
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" 
                            FilterControlAltText="Filter ID column" HeaderText="ID" ReadOnly="True" 
                            SortExpression="ID" UniqueName="ID">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Name" 
                            FilterControlAltText="Filter Name column" HeaderText="Name" 
                            SortExpression="Name" UniqueName="Name">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Description" 
                            FilterControlAltText="Filter Description column" HeaderText="Description" 
                            SortExpression="Description" UniqueName="Description">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="DefaultSets" DataType="System.Int32" 
                            FilterControlAltText="Filter DefaultSets column" HeaderText="DefaultSets" 
                            SortExpression="DefaultSets" UniqueName="DefaultSets">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="DefaultReps" DataType="System.Int32" 
                            FilterControlAltText="Filter DefaultReps column" HeaderText="DefaultReps" 
                            SortExpression="DefaultReps" UniqueName="DefaultReps">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="BaseResistance" DataType="System.Int32" 
                            FilterControlAltText="Filter BaseResistance column" HeaderText="BaseResistance" 
                            SortExpression="BaseResistance" UniqueName="BaseResistance">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Resource.Name" DataType="System.Int32" 
                            FilterControlAltText="Filter ResourceID column" HeaderText="Resource" 
                            UniqueName="ResourceID">
                        </telerik:GridBoundColumn>
                    </Columns>
                    <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                        </EditColumn>
                    </EditFormSettings>
                </MasterTableView>
                <FilterMenu EnableImageSprites="False">
                    <WebServiceSettings>
                        <ODataSettings InitialContainerName="">
                        </ODataSettings>
                    </WebServiceSettings>
                </FilterMenu>
                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                    <WebServiceSettings>
                        <ODataSettings InitialContainerName="">
                        </ODataSettings>
                    </WebServiceSettings>
                </HeaderContextMenu>
            </telerik:RadGrid>
            <br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" 
                CommandName="Cancel" Text="Cancel" />
        </EditItemTemplate>
    </asp:FormView>
    <asp:EntityDataSource ID="EntityDsMember" runat="server" 
        ConnectionString="name=FatFreeFitnessEntities" 
        DefaultContainerName="FatFreeFitnessEntities" EnableFlattening="False" 
        EnableUpdate="True" EntitySetName="Members" EntityTypeFilter="" Select="" AutoGenerateWhereClause="true"
        >
        <WhereParameters>
            <mem:MemberIDParameter Name="ID" />
        </WhereParameters>
    </asp:EntityDataSource>
    </asp:Content>
